﻿using furion.blog.Application.Contracts;
using furion.blog.Domain.IRepositories;
using furion.blog.Domain.MySQL;
using furion.blog.Domain.Query.RequestLog;
using furion.blog.Domain.Shared;
using Furion.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Application
{
    public class RequestLogService : IRequestLogService, ISingleton
    {
        private readonly IRequestLogRepository _requestLogRepository;

        public RequestLogService(IRequestLogRepository requestLogRepository) {
            this._requestLogRepository = requestLogRepository;
        }

        public async Task Save(List<RequestLog> data) {
            await this._requestLogRepository.Save(data);
        }

        /// <summary>
        /// 详情
        /// </summary>
        /// <param name="date">YYYYMMDD</param>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RequestLog> Detail(string date,long id) {
            return await this._requestLogRepository.Detail(date,id);
        }

        /// <summary>
        /// 分页
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public async Task<PageVO> List(RequestLogListQuery query) {
            return await this._requestLogRepository.List(query);
        }

    }
}
